|
|
|
|
|
|
|
Let the program run for several seconds and click the Stop button. Then click the Go button again. Several seconds pass before the program begins plotting new points. The program spends the first several seconds replotting the exact same points it plotted before. |
|
|
|
|
|
|
|
|
Stop the program again and change the value of X0 slightly. If the initial value of X0 was 0, change it to 0.0001. Then click the Go button again. This time, the program begins to generate new points immediately. This demonstrates an important feature of many chaotic systems: Initial conditions that differ by only a tiny amount often produce very different results. Even though the two initial conditions differed by only 0.0001, the equations produced different points right away. If you experiment with other initial values, you will see the same effect. Different values produce different points, but they all follow the same strange attractor. |
|
|
|
|
|
|
|
|
Mathematically speaking, a tiling is a collection of sets that covers the plane without gaps or overlaps. By that definition, the squares in a checkerboard and the pieces in a jigsaw puzzle form tilings. |
|
|
|
|
|
|
|
|
The study of tilings in mathematics is a huge and complex field. The following sections examine only a few of the simplest kinds of tiles that are possible. These tiles produce patterns that are interesting and easy to use in Visual Basic. |
|
|
|
|
|
|
|
|
The easiest type of tiling to implement in Visual Basic is one that is defined by a rectangular tile. You can cover a form, picture box, or printer object with the tile by repeatedly copying it using the PaintPicture method. |
|
|
|
|
|
|
|
|
The most straightforward way to cover a destination area is to copy the tile in rows and columns. The TilePicture subroutine shown in the following code tiles a picture box with a tile stored in an image control. |
|
|
|
 |
|
|
|
|
' Tile a PictureBox with the picture in an Image control. Private Sub TilePicture(ByVal pic As PictureBox, _
ByVal tile_image As Image)
Dim wid As Integer
Dim hgt As Integer
Dim rows As Integer
Dim cols As Integer
Dim r As Integer
Dim c As Integer
Dim x As Integer
Dim y As Integer
pic.Cls ' Clear the picture box. wid = ScaleX(tile_image.Width, _
tile_image.Parent.ScaleMode, pic.ScaleMode)
hgt = ScaleY(tile_image.Height, _
tile_image.Parent.ScaleMode, pic.ScaleMode) |
|
|
|
|
|